package com.edu.control.deploy.constant;

public enum FaasCli {

    LOGIN("faas-cli login -u ", "", DeployStatus.NEW, false),
    NEW("faas-cli new --lang node12 ", "", DeployStatus.NEW),
    BUILD("faas-cli build -f ./", ".yml", DeployStatus.BUILD),
    PUSH("faas-cli push -f ./", ".yml", DeployStatus.PUSH),
    DEPLOY("faas-cli deploy -f ./", ".yml", DeployStatus.DEPLOY),
    ;

    FaasCli(String command, String suffix, DeployStatus status) {
        this.suffix = suffix;
        this.command = command;
        this.status = status;
    }

    FaasCli(String command, String suffix, DeployStatus status, boolean init) {
        this.suffix = suffix;
        this.command = command;
        this.status = status;
        this.init = init;
    }

    private String suffix;
    private String command;
    private DeployStatus status;
    private volatile boolean init = true;

    public String getSuffix() {
        return suffix;
    }

    public String getCommand() {
        return command;
    }

    public void setCommand(String command) {
        if (!this.init) {
            this.init = true;
            this.command = command;
        }
    }

    public DeployStatus getStatus() {
        return status;
    }
}
